namespace Jumpton.SFA.Server.Entity
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Data;
    using System.Runtime.Serialization;
    using Jumpton.Persistent;
    using Jumpton.SFA.Entity;


    [SerializableAttribute()]
    [RelationMap("Message", typeof(Message), "a")]
    [Relation(RelationJoinType.Inner, typeof(Message_Receive), "b", "a", "MESSAGE_ID", "ID")]
    [Relation(RelationJoinType.Inner, typeof(DictionaryItems), "c", "a", "DictionaryItemID", "CONTENT_LEVEL")]
    public class MessageView : ObjectRow {
        
        public MessageView() {
        }
        
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">DataTable 中的一行数据</param>
        /// <param name="objectTable">存储当前对象的数据表格</param>
        public MessageView(System.Data.DataRow dataRow, ObjectTable parent) : 
                base(dataRow, parent) {
        }
        
        /// <summary>
        /// 供反序列化使用的构造函数
        /// </summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected MessageView(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : 
                base(info, context) {
        }

        [Key("ID", TableAlias = "a")]
        public decimal ID
        {
            get
            {
                return (System.Decimal)GetValue("ID");
            }
            set
            {
                SetValue("ID", value);
            }
        }

        [Key("ID", TableAlias = "a")]
        public decimal RECEIVEID
        {
            get
            {
                return (System.Decimal)GetValue("RECEIVEID");
            }
            set
            {
                SetValue("RECEIVEID", value);
            }
        }

        [Field("TOPIC", TableAlias = "a")]
        public string TOPIC
        {
            get
            {
                return (System.String)GetValue("TOPIC");
            }
            set
            {
                SetValue("TOPIC", value);
            }
        }

        [Field("CONTENT_LEVEL", TableAlias = "a")]
        public int CONTENTLEVEL
        {
            get
            {
                return (System.Int32)GetValue("CONTENTLEVEL");
            }
            set
            {
                SetValue("CONTENTLEVEL", value);
            }
        }

        [Field("CONTENT", TableAlias = "a")]
        public string CONTENT
        {
            get
            {
                return (System.String)GetValue("CONTENT");
            }
            set
            {
                SetValue("CONTENT", value);
            }
        }

        [Field("PHOTO_ID", TableAlias = "a")]
        public string PHOTOID
        {
            get
            {
                return (System.String)GetValue("PHOTOID");
            }
            set
            {
                SetValue("PHOTOID", value);
            }
        }

        [Field("RECEIVER_COUNT", TableAlias = "a")]
        public int RECEIVERCOUNT
        {
            get
            {
                return (System.Int32)GetValue("RECEIVERCOUNT");
            }
            set
            {
                SetValue("RECEIVERCOUNT", value);
            }
        }

        [Field("READ_COUNT", TableAlias = "a")]
        public int READCOUNT
        {
            get
            {
                return (System.Int32)GetValue("READCOUNT");
            }
            set
            {
                SetValue("READCOUNT", value);
            }
        }

        [Field("BEGIN_DATE", TableAlias = "a")]
        public decimal BEGINDATE
        {
            get
            {
                return (System.Decimal)GetValue("BEGINDATE");
            }
            set
            {
                SetValue("BEGINDATE", value);
            }
        }

        [Field("END_DATE", TableAlias = "a")]
        public decimal ENDDATE
        {
            get
            {
                return (System.Decimal)GetValue("ENDDATE");
            }
            set
            {
                SetValue("ENDDATE", value);
            }
        }

        [Field("ACTIVE", TableAlias = "a")]
        public bool ACTIVE
        {
            get
            {
                return (System.Boolean)GetValue("ACTIVE");
            }
            set
            {
                SetValue("ACTIVE", value);
            }
        }

        [Field("DOMAIN_ID", TableAlias = "a")]
        public int DOMAINID
        {
            get
            {
                return (System.Int32)GetValue("DOMAINID");
            }
            set
            {
                SetValue("DOMAINID", value);
            }
        }

        [Field("LAST_UPDATER", TableAlias = "a")]
        public string LAST_UPDATER
        {
            get
            {
                return (System.String)GetValue("LAST_UPDATER");
            }
            set
            {
                SetValue("LAST_UPDATER", value);
            }
        }

        [Field("LAST_UPDATE_TIME", TableAlias = "a")]
        public decimal LAST_UPDATE_TIME
        {
            get
            {
                return (System.Decimal)GetValue("LAST_UPDATE_TIME");
            }
            set
            {
                SetValue("LAST_UPDATE_TIME", value);
            }
        }

        [Field("CREATE_TIME", TableAlias = "a")]
        public decimal CREATETIME
        {
            get
            {
                return (System.Decimal)GetValue("CREATETIME");
            }
            set
            {
                SetValue("CREATETIME", value);
            }
        }



        [Field("PERSON_ID", TableAlias = "b")]
        public int PERSONID
        {
            get
            {
                return (System.Int32)GetValue("PERSONID");
            }
            set
            {
                SetValue("PERSONID", value);
            }
        }

        [Field("READ_FLAG", TableAlias = "b")]
        public bool READFLAG
        {
            get
            {
                return (System.Boolean)GetValue("READFLAG");
            }
            set
            {
                SetValue("READFLAG", value);
            }
        }

        [Field("ALERT_FLAG", TableAlias = "b")]
        public int ALERTFLAG
        {
            get
            {
                return (System.Int32)GetValue("ALERTFLAG");
            }
            set
            {
                SetValue("ALERTFLAG", value);
            }
        }

        [Field("Name", TableAlias = "c")]
        public string Type
        {
            get
            {
                return (System.String)GetValue("Type");
            }
            set
            {
                SetValue("Type", value);
            }
        }
    }
}
